package com.lurencun.android.topicbank.util;

public class TimeUtil {
	
	public static String parseTime(Integer second) {
		int hourInt = second / 3600;
		String hourStr = hourInt < 10 ? "0" + hourInt : Integer.valueOf(hourInt).toString();
		second = second % 3600;
		int minuteInt = second / 60;
		int secondRemainderInt = second % 60;
		String minuteStr = "";
		String secondRemainderStr = "";
		minuteStr = minuteInt < 10 ? "0" + minuteInt : Integer.valueOf(minuteInt).toString();
		secondRemainderStr = secondRemainderInt < 10 ? "0" + secondRemainderInt : Integer.valueOf(secondRemainderInt).toString();
		return hourStr + ":" + minuteStr + ":" + secondRemainderStr;
	}

	public static String parseConferenceTime(Integer second) {
		String result = "";
		int hourInt = second / 3600;
		if (hourInt > 0) {
			result += hourInt + "小时";
		}
		int minuteInt = second % 3600 / 60;
		if (minuteInt > 0) {
			result += minuteInt + "分钟";
		}
		int secondRemainderInt = second % 3600 % 60 % 60;
		if (secondRemainderInt > 0) {
			result += secondRemainderInt + "秒";
		}
		return result;
	}

	public static String parseTime(Long timeUsed) {
		return parseTime(Integer.parseInt(String.valueOf(timeUsed)));
	}
}
